#version 450 core
#extension GL_ARB_explicit_uniform_location : require

layout(location = 0) in vec3 normal;
layout(location = 1) in vec3 fragPos;
layout(location = 2) in vec2 texCoord;
layout(location = 0) out vec4 fragColor;

struct World {
    vec3 cameraPos;
    mat4 matVP;
};
layout(binding = 0, std140) uniform WorldBlock {
    World world;
};

layout(binding = 1, std140) uniform TextureBlock {
    uint numDiffuse;
    uint numSpecular;
    uint numNormal;
    uint numHeight;
};

struct Transform {
    mat4 modelMatrix; // 2
    mat4 mvpMatrix; // 3
    mat4 normalMatrix; // 4
};
layout(location = 2) uniform Transform transform;

layout(binding = 0) uniform sampler2D diffuseMap0;
layout(binding = 1) uniform sampler2D diffuseMap1;
layout(binding = 2) uniform sampler2D diffuseMap2;
layout(binding = 3) uniform sampler2D diffuseMap3;
layout(binding = 4) uniform sampler2D specularMap0;
layout(binding = 5) uniform sampler2D specularMap1;
layout(binding = 6) uniform sampler2D specularMap2;
layout(binding = 7) uniform sampler2D specularMap3;
layout(binding = 8) uniform sampler2D normalMap0;
layout(binding = 9) uniform sampler2D normalMap1;
layout(binding = 10) uniform sampler2D normalMap2;
layout(binding = 11) uniform sampler2D normalMap3;
layout(binding = 12) uniform sampler2D heightMap0;
layout(binding = 13) uniform sampler2D heightMap1;
layout(binding = 14) uniform sampler2D heightMap2;
layout(binding = 15) uniform sampler2D heightMap3;

void main() {
    // fragColor = vec4(1.0f);
    fragColor = texture(diffuseMap0, texCoord);
}
